<template>
  <div>
    <el-collapse v-model="activeNames">
      <el-collapse-item :title="$t('message.personalInfo')" name="personalInfo">
        <el-row>
          <el-form :model="userDetailInfo" label-width="118px" style="width: 500px;">
            <el-form-item label="id">
              <el-input disabled v-model="userDetailInfo.id" />
            </el-form-item>
            <el-form-item label="userAccount">
              <el-input disabled v-model="userDetailInfo.userAccount" />
            </el-form-item>

            <el-form-item label="createTime">
              <el-input disabled v-model="userDetailInfo.createTime" />
            </el-form-item>

            <el-form-item label="updateTime">
              <el-input disabled v-model="userDetailInfo.updateTime" />
            </el-form-item>
          </el-form>
        </el-row>
      </el-collapse-item>
    </el-collapse>
  </div>
</template>

<script>
export default {
  name: 'UserCenter',
  data() {
    return {
      // 激活的菜单列表
      activeNames: ['personalInfo'],
      // 用户详细信息
      userDetailInfo: {
        id: undefined,
        userAccount: undefined,
        createTime: undefined,
        updateTime: undefined,
      },
    }
  },

  methods: {
    fetchUserDetail() {
      const that = this;
      this.axios.get('/user/getLoginUser').then(ret => {
        that.userDetailInfo = ret.data
      })
    },
  },
  mounted() {
    this.fetchUserDetail()
  }
}
</script>
